package py.com.alfa.escriba.persistence.dto.marker;

import py.com.alfa.escriba.persistence.dto.MonedasDTO;

public class CtrlVehiculoMarkerDTO  {
	private Long id;
	private VehiculoMarkerDTO vehiculo;
	private MonedasDTO moneda;
	private String nroChasis;
	private Long valor;
	private Integer orden;
	
	public VehiculoMarkerDTO getVehiculo() {
		return vehiculo;
	}
	public void setVehiculo(VehiculoMarkerDTO vehiculo) {
		this.vehiculo = vehiculo;
	}
	public MonedasDTO getMoneda() {
		return moneda;
	}
	public void setMoneda(MonedasDTO moneda) {
		this.moneda = moneda;
	}
	public String getNroChasis() {
		return nroChasis;
	}
	public void setNroChasis(String nrochasis) {
		this.nroChasis = nrochasis;
	}
	public Long getValor() {
		return valor;
	}
	public void setValor(Long valor) {
		this.valor = valor;
	}
	public Integer getOrden() {
		return orden;
	}
	public void setOrden(Integer orden) {
		this.orden = orden;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public String vehiculoByInfo(String tipo) {
		if ( this.vehiculo == null || tipo == null) {
			return null;
		}
		if ( this.vehiculo.getInfo() == null) {
			return null;
		}
		for (VehiculoinfoMarkerDTO dto : this.vehiculo.getInfo()) {
			if ( tipo.equals(dto.getDatoComplementario().getCodigo())) {
				return dto.getValor();
			}
		}
		return null;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("CtrlVehiculoMarkerDTO [id=").append(id)
				.append(", vehiculo=").append(vehiculo).append(", moneda=")
				.append(moneda).append(", nroChasis=").append(nroChasis)
				.append(", valor=").append(valor).append(", orden=")
				.append(orden).append("]");
		return builder.toString();
	}
	


}